Skip to content

Update antimalware.py to be more consistent with other information messages & improve code a slight bit#671

Merged
lemonsaurus merged 7 commits into
python-discord:masterfrom
Denayder:master
Nov 30, 2019
Merged

Update antimalware.py to be more consistent with other information messages & improve code a slight bit#671
lemonsaurus merged 7 commits into
python-discord:masterfrom
Denayder:master

Conversation

@Denayder
Copy link
Copy Markdown

Hey! I looked at the antimalware.py and felt like I could improve a bit, and I hope I've accomplished that. I look forward to your review of this pull request! 😁

Here's a list of differences that has been made:

  • Messages are now only checked if they contain 1 or more attachments.
  • Warning message is now in an embed, but the mention is still text so the user still gets pinged. This is more consistent with other reminders (such as this one: https://prnt.sc/q1t6g7)
  • Less if statements and variables
  • Removed the try/except block: I don't believe deleting a message from on_message can ever return NotFound. If I'm wrong, I'm more than happy to add that back in.
  • If a user sends an illegal file, a list of allowed file types are displayed in the message as well, so they know what they can use.

I think this is an overall improvement to the message and code itself, and I hope you guys agree 😁

Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, just two small things

Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
Comment thread bot/cogs/antimalware.py Outdated
…/except block and implement the changes requested by Ava
@Denayder
Copy link
Copy Markdown
Author

All requested tweaks have been made :)

@Akarys42
Copy link
Copy Markdown
Contributor

Akarys42 commented Nov 25, 2019

Have you created the default constant in the config-default.yml file? My bad it is already in it

Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Copy link
Copy Markdown
Contributor

@avayert avayert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good refactor.

@lemonsaurus lemonsaurus merged commit be11622 into python-discord:master Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants